package com.isoft.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.xml.bind.annotation.*;
import lombok.Data;

import java.util.List;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfmeBllsEntity {
    @JsonProperty("meta")
    @XmlElement(name = "META")
    private Meta meta;

    @JsonProperty("dflt")
    @XmlElement(name = "DFLT")
    private Dflt dflt;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "SNDR")
        private String sender;
        @XmlElement(name = "RCVR")
        private String receiver;
        @XmlElement(name = "SEQN")
        private Long sequenceNumber;
        @XmlElement(name = "DDTM")
        private String dateTime;
        @XmlElement(name = "TYPE")
        private String type;
        @XmlElement(name = "STYP")
        private String subType;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dflt {
        @XmlElement(name = "FLID")
        private Long flightId;
        @XmlElement(name = "FFID")
        private String flightFileId;
        @XmlElement(name = "FIDE")
        private String flightIdentifier;
        @XmlElement(name = "FATT")
        private String flightAttribute;
        @XmlElement(name = "BLLS")
        private String blls;

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Blls {
            @XmlElement(name = "BELT")
            private List<Belt> belts;

            @Data
            @XmlAccessorType(XmlAccessType.FIELD)
            public static class Belt {
                @XmlElement(name = "BTNO")
                private String beltNumber;
                @XmlElement(name = "ID")
                private Long id;
                @XmlElement(name = "CODE")
                private String code;
                @XmlElement(name = "BTAT")
                private String beltAttribute;
                @XmlElement(name = "ESTR")
                private String estimatedStartTime;
                @XmlElement(name = "EEND")
                private String estimatedEndTime;
                @XmlElement(name = "RSTR")
                private String realStartTime;
                @XmlElement(name = "REND")
                private String realEndTime;
                @XmlElement(name = "BTSC")
                private List<String> beltSection;
            }
        }

        public Long getFlightId() { return flightId; }
        public void setFlightId(Long flightId) { this.flightId = flightId; }
        public String getBlls() { return blls; }
        public void setBlls(String blls) { this.blls = blls; }
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public Dflt getDflt() {
        return dflt;
    }

    public void setDflt(Dflt dflt) {
        this.dflt = dflt;
    }
}